<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>项目管理平台 - 登录</title>
<style>
	@media (min-width:0px) and (max-width:992px) {
		.cls{
			width:80%;
			height:100px;
			margin-top:50px;
			font-size:32pt;
		}
	}
	@media (min-width:992px) {
		.cls{
			width:auto;
		}
	}
</style>
</head>
<body>
<form target="iframe" action="/login?utf8" method="post" style="text-align:center;margin-top:100px">
<input type="text" name="id" placeholder="账号" class="cls"/><p>
<input type="password" name="password" placeholder="密码" class="cls"/><p>
<input type="submit" value="登录" class="cls"/>
</form>
<script type="text/javascript">
var loaded=false;
function onLogin(){
	if(!loaded){
		loaded=true;
		return;
	}
	let text=document.getElementById("iframe").contentWindow.document.body.innerText;
	if(text.length==0){
		alert("账号或密码错误");
		return;
	}
	localStorage.setItem("maininfo",encodeURIComponent(text));
	window.location.href="/index.html";
}
</script>
<iframe name="iframe" id="iframe" style="display:none" onload="onLogin()"></iframe>
</body>
</html>